﻿using System;
using System.Data;
using Model;
using DBUtility;

namespace DAL
{
     /// <summary>
     /// 数据访问层TYPE_CX_CONTENT_DAL
     /// </summary>
     public class TYPE_CX_CONTENT_DAL
     {
         public TYPE_CX_CONTENT_DAL()
         {
         }


         /// <summary>
         /// 得到最大ID
         /// </summary>
         public int GetMax_ID(string p_strWhere)
         {
             int intResult = 0;
             string strSql = "select max(ID) as m from TYPE_CX_CONTENT";

             if(p_strWhere.Trim().Length > 0)
             {
                 strSql += " where " + p_strWhere;
             }

             DataTable dtTemp = new DataTable();
             DbHelper.GetTable(strSql, ref dtTemp);

             if(dtTemp.Rows.Count>0)
             {
                 if(dtTemp.Rows[0]["m"].ToString().Length>0)
                 {
                     intResult = dtTemp.Rows[0]["m"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["m"]);
                 }
             }

             dtTemp.Dispose();

             return intResult + 1;

          }

          /// <summary>
          /// 得到最大ID
          /// </summary>
          public int GetMax_ID()
          {
              return GetMax_ID("");
          }


          /// <summary>
          /// 判断数据是否存在
          /// </summary>
          public bool Exists(int intID)
          {
               bool bolResult = false;


               string strSql = "";
               strSql += "select count(1) as c from TYPE_CX_CONTENT";
               strSql += " where ";
               strSql += " ID='"+ intID +"'";

               DataTable dtTemp = new DataTable();
               DbHelper.GetTable(strSql, ref dtTemp);

               if (dtTemp.Rows.Count > 0)
               {
                   bolResult = Convert.ToInt32(dtTemp.Rows[0]["c"]) > 0;
               }

               dtTemp.Dispose();

               return bolResult;

          }

          /// <summary>
          /// 获取数据总记录数
          /// </summary>
          public int GetRecordCount(string p_strWhere)
          {
              int intResult=0;

              string strSql = "";
              strSql += "select count(1) as c from TYPE_CX_CONTENT";
              if(p_strWhere.Trim().Length > 0)
              {
                 strSql += " where " + p_strWhere;
              }

              DataTable dtTemp = new DataTable();
              DbHelper.GetTable(strSql, ref dtTemp);

              if(dtTemp.Rows.Count>0)
              {
                  intResult=Convert.ToInt32(dtTemp.Rows[0]["c"]);
              }

              dtTemp.Dispose();

              return intResult;
          }

          /// <summary>
          /// 获取数据总记录数
          /// </summary>
          public int GetRecordCount()
          {
              return GetRecordCount("");
          }

          /// <summary>
          /// 获取数据分页总数
           /// </summary>
          public int GetPageCount(string p_strWhere, int p_intPageSize)
          {
              int intResult=0;

              if(p_intPageSize > 0)
              {
                  int intRecordCount = GetRecordCount(p_strWhere);
                  intResult = Convert.ToInt32(Math.Truncate(Convert.ToDecimal(intRecordCount) / Convert.ToDecimal(p_intPageSize)));
                  if (intRecordCount > (intResult * p_intPageSize))
                  {
                       intResult++;
                  }
              }

              if(intResult == 0)
              {
                   intResult++;
              }
              return intResult;
           }

          /// <summary>
          /// 获取数据分页总数
          /// </summary>
          public int GetPageCount(int p_intPageSize)
          {
              return GetPageCount("", p_intPageSize);
          }

          /// <summary>
          /// 添加一条数据 SQL
          /// </summary>
          public string InsertSQL(TYPE_CX_CONTENT model)
          {
              string strFieldSQL = "";
              string strValueSQL = "";

              if(model.Changed("CPMC") == true && model.CPMC != null)
              {
                   strFieldSQL += ",CPMC";
                   strValueSQL += ",'" + model.CPMC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("PP") == true && model.PP != null)
              {
                   strFieldSQL += ",PP";
                   strValueSQL += ",'" + model.PP.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("XH") == true && model.XH != null)
              {
                   strFieldSQL += ",XH";
                   strValueSQL += ",'" + model.XH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("PPXH") == true && model.PPXH != null)
              {
                   strFieldSQL += ",PPXH";
                   strValueSQL += ",'" + model.PPXH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CXDM") == true && model.CXDM != null)
              {
                   strFieldSQL += ",CXDM";
                   strValueSQL += ",'" + model.CXDM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SFDABS") == true && model.SFDABS != null)
              {
                   strFieldSQL += ",SFDABS";
                   strValueSQL += ",'" + model.SFDABS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ABSZWZ") == true && model.ABSZWZ != null)
              {
                   strFieldSQL += ",ABSZWZ";
                   strValueSQL += ",'" + model.ABSZWZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QDXS") == true && model.QDXS != null)
              {
                   strFieldSQL += ",QDXS";
                   strValueSQL += ",'" + model.QDXS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QDZWZ") == true && model.QDZWZ != null)
              {
                   strFieldSQL += ",QDZWZ";
                   strValueSQL += ",'" + model.QDZWZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCZWZ") == true && model.ZCZWZ != null)
              {
                   strFieldSQL += ",ZCZWZ";
                   strValueSQL += ",'" + model.ZCZWZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QZDZ") == true && model.QZDZ != null)
              {
                   strFieldSQL += ",QZDZ";
                   strValueSQL += ",'" + model.QZDZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZBZL") == true && model.ZBZL != null)
              {
                   strFieldSQL += ",ZBZL";
                   strValueSQL += ",'" + model.ZBZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZZL") == true && model.ZZL != null)
              {
                   strFieldSQL += ",ZZL";
                   strValueSQL += ",'" + model.ZZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HDZH") == true && model.HDZH != null)
              {
                   strFieldSQL += ",HDZH";
                   strValueSQL += ",'" + model.HDZH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZZS") == true && model.ZZS != null)
              {
                   strFieldSQL += ",ZZS";
                   strValueSQL += ",'" + model.ZZS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CYS") == true && model.CYS != null)
              {
                   strFieldSQL += ",CYS";
                   strValueSQL += ",'" + model.CYS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZGSJCS") == true && model.ZGSJCS != null)
              {
                   strFieldSQL += ",ZGSJCS";
                   strValueSQL += ",'" + model.ZGSJCS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZDFS") == true && model.ZDFS != null)
              {
                   strFieldSQL += ",ZDFS";
                   strValueSQL += ",'" + model.ZDFS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLZL") == true && model.CLZL != null)
              {
                   strFieldSQL += ",CLZL";
                   strValueSQL += ",'" + model.CLZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZXZXJXS") == true && model.ZXZXJXS != null)
              {
                   strFieldSQL += ",ZXZXJXS";
                   strValueSQL += ",'" + model.ZXZXJXS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZXZLX") == true && model.ZXZLX != null)
              {
                   strFieldSQL += ",ZXZLX";
                   strValueSQL += ",'" + model.ZXZLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("BSXLX") == true && model.BSXLX != null)
              {
                   strFieldSQL += ",BSXLX";
                   strValueSQL += ",'" + model.BSXLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTQY") == true && model.LTQY != null)
              {
                   strFieldSQL += ",LTQY";
                   strValueSQL += ",'" + model.LTQY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTGG") == true && model.LTGG != null)
              {
                   strFieldSQL += ",LTGG";
                   strValueSQL += ",'" + model.LTGG.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTGGLX") == true && model.LTGGLX != null)
              {
                   strFieldSQL += ",LTGGLX";
                   strValueSQL += ",'" + model.LTGGLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTSL") == true && model.LTSL != null)
              {
                   strFieldSQL += ",LTSL";
                   strValueSQL += ",'" + model.LTSL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CSC") == true && model.CSC != null)
              {
                   strFieldSQL += ",CSC";
                   strValueSQL += ",'" + model.CSC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CSK") == true && model.CSK != null)
              {
                   strFieldSQL += ",CSK";
                   strValueSQL += ",'" + model.CSK.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CSG") == true && model.CSG != null)
              {
                   strFieldSQL += ",CSG";
                   strValueSQL += ",'" + model.CSG.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZJ") == true && model.ZJ != null)
              {
                   strFieldSQL += ",ZJ";
                   strValueSQL += ",'" + model.ZJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("BZZXS") == true && model.BZZXS != null)
              {
                   strFieldSQL += ",BZZXS";
                   strValueSQL += ",'" + model.BZZXS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YZLJ") == true && model.YZLJ != null)
              {
                   strFieldSQL += ",YZLJ";
                   strValueSQL += ",'" + model.YZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("EZLJ") == true && model.EZLJ != null)
              {
                   strFieldSQL += ",EZLJ";
                   strValueSQL += ",'" + model.EZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SZLJ") == true && model.SZLJ != null)
              {
                   strFieldSQL += ",SZLJ";
                   strValueSQL += ",'" + model.SZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SIZLJ") == true && model.SIZLJ != null)
              {
                   strFieldSQL += ",SIZLJ";
                   strValueSQL += ",'" + model.SIZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WZLJ") == true && model.WZLJ != null)
              {
                   strFieldSQL += ",WZLJ";
                   strValueSQL += ",'" + model.WZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LZLJ") == true && model.LZLJ != null)
              {
                   strFieldSQL += ",LZLJ";
                   strValueSQL += ",'" + model.LZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YZZLZ") == true && model.YZZLZ != null)
              {
                   strFieldSQL += ",YZZLZ";
                   strValueSQL += ",'" + model.YZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YZYLZ") == true && model.YZYLZ != null)
              {
                   strFieldSQL += ",YZYLZ";
                   strValueSQL += ",'" + model.YZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YZZZ") == true && model.YZZZ != null)
              {
                   strFieldSQL += ",YZZZ";
                   strValueSQL += ",'" + model.YZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("EZZLZ") == true && model.EZZLZ != null)
              {
                   strFieldSQL += ",EZZLZ";
                   strValueSQL += ",'" + model.EZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("EZYLZ") == true && model.EZYLZ != null)
              {
                   strFieldSQL += ",EZYLZ";
                   strValueSQL += ",'" + model.EZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("EZZZ") == true && model.EZZZ != null)
              {
                   strFieldSQL += ",EZZZ";
                   strValueSQL += ",'" + model.EZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SZZLZ") == true && model.SZZLZ != null)
              {
                   strFieldSQL += ",SZZLZ";
                   strValueSQL += ",'" + model.SZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SZYLZ") == true && model.SZYLZ != null)
              {
                   strFieldSQL += ",SZYLZ";
                   strValueSQL += ",'" + model.SZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SZZZ") == true && model.SZZZ != null)
              {
                   strFieldSQL += ",SZZZ";
                   strValueSQL += ",'" + model.SZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SIZZLZ") == true && model.SIZZLZ != null)
              {
                   strFieldSQL += ",SIZZLZ";
                   strValueSQL += ",'" + model.SIZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SIZYLZ") == true && model.SIZYLZ != null)
              {
                   strFieldSQL += ",SIZYLZ";
                   strValueSQL += ",'" + model.SIZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SIZZZ") == true && model.SIZZZ != null)
              {
                   strFieldSQL += ",SIZZZ";
                   strValueSQL += ",'" + model.SIZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WZZLZ") == true && model.WZZLZ != null)
              {
                   strFieldSQL += ",WZZLZ";
                   strValueSQL += ",'" + model.WZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WZYLZ") == true && model.WZYLZ != null)
              {
                   strFieldSQL += ",WZYLZ";
                   strValueSQL += ",'" + model.WZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WZZZ") == true && model.WZZZ != null)
              {
                   strFieldSQL += ",WZZZ";
                   strValueSQL += ",'" + model.WZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LZZLZ") == true && model.LZZLZ != null)
              {
                   strFieldSQL += ",LZZLZ";
                   strValueSQL += ",'" + model.LZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LZYLZ") == true && model.LZYLZ != null)
              {
                   strFieldSQL += ",LZYLZ";
                   strValueSQL += ",'" + model.LZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LZZZ") == true && model.LZZZ != null)
              {
                   strFieldSQL += ",LZZZ";
                   strValueSQL += ",'" + model.LZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QDZKZZL") == true && model.QDZKZZL != null)
              {
                   strFieldSQL += ",QDZKZZL";
                   strValueSQL += ",'" + model.QDZKZZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YHXZ") == true && model.YHXZ != null)
              {
                   strFieldSQL += ",YHXZ";
                   strValueSQL += ",'" + model.YHXZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YHSD") == true && model.YHSD != null)
              {
                   strFieldSQL += ",YHSD";
                   strValueSQL += ",'" + model.YHSD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YDXZ") == true && model.YDXZ != null)
              {
                   strFieldSQL += ",YDXZ";
                   strValueSQL += ",'" + model.YDXZ.ToString().Replace("'","''") + "'";
              }

              string strSql = "";
              strSql += "insert into TYPE_CX_CONTENT";
              strSql += "(";
              strSql += strFieldSQL.Substring(1);
              strSql += ")";
              strSql += " values";
              strSql += "(";
              strSql += strValueSQL.Substring(1);
              strSql += ")";

              return strSql;
          }

          /// <summary>
          /// 添加一条数据
          /// </summary>
          public bool Insert(TYPE_CX_CONTENT model)
          {
              return DbHelper.ExecuteSql(InsertSQL(model));
          }

          /// <summary>
          /// 修改一条数据 SQL
          /// </summary>
          public string UpdateSQL(TYPE_CX_CONTENT model,int intID)
          {
              string strUpdateSQL = "";

              if(model.Changed("CPMC") == true && model.CPMC != null)
              {
                  strUpdateSQL += ",CPMC='" + model.CPMC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("PP") == true && model.PP != null)
              {
                  strUpdateSQL += ",PP='" + model.PP.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("XH") == true && model.XH != null)
              {
                  strUpdateSQL += ",XH='" + model.XH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("PPXH") == true && model.PPXH != null)
              {
                  strUpdateSQL += ",PPXH='" + model.PPXH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CXDM") == true && model.CXDM != null)
              {
                  strUpdateSQL += ",CXDM='" + model.CXDM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SFDABS") == true && model.SFDABS != null)
              {
                  strUpdateSQL += ",SFDABS='" + model.SFDABS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ABSZWZ") == true && model.ABSZWZ != null)
              {
                  strUpdateSQL += ",ABSZWZ='" + model.ABSZWZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QDXS") == true && model.QDXS != null)
              {
                  strUpdateSQL += ",QDXS='" + model.QDXS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QDZWZ") == true && model.QDZWZ != null)
              {
                  strUpdateSQL += ",QDZWZ='" + model.QDZWZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCZWZ") == true && model.ZCZWZ != null)
              {
                  strUpdateSQL += ",ZCZWZ='" + model.ZCZWZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QZDZ") == true && model.QZDZ != null)
              {
                  strUpdateSQL += ",QZDZ='" + model.QZDZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZBZL") == true && model.ZBZL != null)
              {
                  strUpdateSQL += ",ZBZL='" + model.ZBZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZZL") == true && model.ZZL != null)
              {
                  strUpdateSQL += ",ZZL='" + model.ZZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HDZH") == true && model.HDZH != null)
              {
                  strUpdateSQL += ",HDZH='" + model.HDZH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZZS") == true && model.ZZS != null)
              {
                  strUpdateSQL += ",ZZS='" + model.ZZS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CYS") == true && model.CYS != null)
              {
                  strUpdateSQL += ",CYS='" + model.CYS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZGSJCS") == true && model.ZGSJCS != null)
              {
                  strUpdateSQL += ",ZGSJCS='" + model.ZGSJCS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZDFS") == true && model.ZDFS != null)
              {
                  strUpdateSQL += ",ZDFS='" + model.ZDFS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLZL") == true && model.CLZL != null)
              {
                  strUpdateSQL += ",CLZL='" + model.CLZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZXZXJXS") == true && model.ZXZXJXS != null)
              {
                  strUpdateSQL += ",ZXZXJXS='" + model.ZXZXJXS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZXZLX") == true && model.ZXZLX != null)
              {
                  strUpdateSQL += ",ZXZLX='" + model.ZXZLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("BSXLX") == true && model.BSXLX != null)
              {
                  strUpdateSQL += ",BSXLX='" + model.BSXLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTQY") == true && model.LTQY != null)
              {
                  strUpdateSQL += ",LTQY='" + model.LTQY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTGG") == true && model.LTGG != null)
              {
                  strUpdateSQL += ",LTGG='" + model.LTGG.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTGGLX") == true && model.LTGGLX != null)
              {
                  strUpdateSQL += ",LTGGLX='" + model.LTGGLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTSL") == true && model.LTSL != null)
              {
                  strUpdateSQL += ",LTSL='" + model.LTSL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CSC") == true && model.CSC != null)
              {
                  strUpdateSQL += ",CSC='" + model.CSC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CSK") == true && model.CSK != null)
              {
                  strUpdateSQL += ",CSK='" + model.CSK.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CSG") == true && model.CSG != null)
              {
                  strUpdateSQL += ",CSG='" + model.CSG.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZJ") == true && model.ZJ != null)
              {
                  strUpdateSQL += ",ZJ='" + model.ZJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("BZZXS") == true && model.BZZXS != null)
              {
                  strUpdateSQL += ",BZZXS='" + model.BZZXS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YZLJ") == true && model.YZLJ != null)
              {
                  strUpdateSQL += ",YZLJ='" + model.YZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("EZLJ") == true && model.EZLJ != null)
              {
                  strUpdateSQL += ",EZLJ='" + model.EZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SZLJ") == true && model.SZLJ != null)
              {
                  strUpdateSQL += ",SZLJ='" + model.SZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SIZLJ") == true && model.SIZLJ != null)
              {
                  strUpdateSQL += ",SIZLJ='" + model.SIZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WZLJ") == true && model.WZLJ != null)
              {
                  strUpdateSQL += ",WZLJ='" + model.WZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LZLJ") == true && model.LZLJ != null)
              {
                  strUpdateSQL += ",LZLJ='" + model.LZLJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YZZLZ") == true && model.YZZLZ != null)
              {
                  strUpdateSQL += ",YZZLZ='" + model.YZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YZYLZ") == true && model.YZYLZ != null)
              {
                  strUpdateSQL += ",YZYLZ='" + model.YZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YZZZ") == true && model.YZZZ != null)
              {
                  strUpdateSQL += ",YZZZ='" + model.YZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("EZZLZ") == true && model.EZZLZ != null)
              {
                  strUpdateSQL += ",EZZLZ='" + model.EZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("EZYLZ") == true && model.EZYLZ != null)
              {
                  strUpdateSQL += ",EZYLZ='" + model.EZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("EZZZ") == true && model.EZZZ != null)
              {
                  strUpdateSQL += ",EZZZ='" + model.EZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SZZLZ") == true && model.SZZLZ != null)
              {
                  strUpdateSQL += ",SZZLZ='" + model.SZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SZYLZ") == true && model.SZYLZ != null)
              {
                  strUpdateSQL += ",SZYLZ='" + model.SZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SZZZ") == true && model.SZZZ != null)
              {
                  strUpdateSQL += ",SZZZ='" + model.SZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SIZZLZ") == true && model.SIZZLZ != null)
              {
                  strUpdateSQL += ",SIZZLZ='" + model.SIZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SIZYLZ") == true && model.SIZYLZ != null)
              {
                  strUpdateSQL += ",SIZYLZ='" + model.SIZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SIZZZ") == true && model.SIZZZ != null)
              {
                  strUpdateSQL += ",SIZZZ='" + model.SIZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WZZLZ") == true && model.WZZLZ != null)
              {
                  strUpdateSQL += ",WZZLZ='" + model.WZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WZYLZ") == true && model.WZYLZ != null)
              {
                  strUpdateSQL += ",WZYLZ='" + model.WZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WZZZ") == true && model.WZZZ != null)
              {
                  strUpdateSQL += ",WZZZ='" + model.WZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LZZLZ") == true && model.LZZLZ != null)
              {
                  strUpdateSQL += ",LZZLZ='" + model.LZZLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LZYLZ") == true && model.LZYLZ != null)
              {
                  strUpdateSQL += ",LZYLZ='" + model.LZYLZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LZZZ") == true && model.LZZZ != null)
              {
                  strUpdateSQL += ",LZZZ='" + model.LZZZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QDZKZZL") == true && model.QDZKZZL != null)
              {
                  strUpdateSQL += ",QDZKZZL='" + model.QDZKZZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YHXZ") == true && model.YHXZ != null)
              {
                  strUpdateSQL += ",YHXZ='" + model.YHXZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YHSD") == true && model.YHSD != null)
              {
                  strUpdateSQL += ",YHSD='" + model.YHSD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YDXZ") == true && model.YDXZ != null)
              {
                  strUpdateSQL += ",YDXZ='" + model.YDXZ.ToString().Replace("'","''") + "'";
              }

               string strSql = "";
               strSql += "update TYPE_CX_CONTENT set ";
               strSql += strUpdateSQL.Substring(1);
               strSql += " where ";
               strSql += " ID="+ intID +"";

               return strSql;
          }

          /// <summary>
          /// 修改一条数据
          /// </summary>
          public bool Update(TYPE_CX_CONTENT model, int intID)
          {
              return DbHelper.ExecuteSql(UpdateSQL(model, intID));
          }

          /// <summary>
          /// 修改一个集合 SQL
          /// </summary>
           public string UpdateRangeSQL(TYPE_CX_CONTENT model, string p_strWhere)
          {
               string strUpdateSQL = "";

               if(model.Changed("CPMC") == true && model.CPMC != null)
               {
                  strUpdateSQL += ",CPMC='" + model.CPMC.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("PP") == true && model.PP != null)
               {
                  strUpdateSQL += ",PP='" + model.PP.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("XH") == true && model.XH != null)
               {
                  strUpdateSQL += ",XH='" + model.XH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("PPXH") == true && model.PPXH != null)
               {
                  strUpdateSQL += ",PPXH='" + model.PPXH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CXDM") == true && model.CXDM != null)
               {
                  strUpdateSQL += ",CXDM='" + model.CXDM.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SFDABS") == true && model.SFDABS != null)
               {
                  strUpdateSQL += ",SFDABS='" + model.SFDABS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ABSZWZ") == true && model.ABSZWZ != null)
               {
                  strUpdateSQL += ",ABSZWZ='" + model.ABSZWZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("QDXS") == true && model.QDXS != null)
               {
                  strUpdateSQL += ",QDXS='" + model.QDXS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("QDZWZ") == true && model.QDZWZ != null)
               {
                  strUpdateSQL += ",QDZWZ='" + model.QDZWZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZCZWZ") == true && model.ZCZWZ != null)
               {
                  strUpdateSQL += ",ZCZWZ='" + model.ZCZWZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("QZDZ") == true && model.QZDZ != null)
               {
                  strUpdateSQL += ",QZDZ='" + model.QZDZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZBZL") == true && model.ZBZL != null)
               {
                  strUpdateSQL += ",ZBZL='" + model.ZBZL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZZL") == true && model.ZZL != null)
               {
                  strUpdateSQL += ",ZZL='" + model.ZZL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HDZH") == true && model.HDZH != null)
               {
                  strUpdateSQL += ",HDZH='" + model.HDZH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZZS") == true && model.ZZS != null)
               {
                  strUpdateSQL += ",ZZS='" + model.ZZS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CYS") == true && model.CYS != null)
               {
                  strUpdateSQL += ",CYS='" + model.CYS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZGSJCS") == true && model.ZGSJCS != null)
               {
                  strUpdateSQL += ",ZGSJCS='" + model.ZGSJCS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZDFS") == true && model.ZDFS != null)
               {
                  strUpdateSQL += ",ZDFS='" + model.ZDFS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CLZL") == true && model.CLZL != null)
               {
                  strUpdateSQL += ",CLZL='" + model.CLZL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZXZXJXS") == true && model.ZXZXJXS != null)
               {
                  strUpdateSQL += ",ZXZXJXS='" + model.ZXZXJXS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZXZLX") == true && model.ZXZLX != null)
               {
                  strUpdateSQL += ",ZXZLX='" + model.ZXZLX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("BSXLX") == true && model.BSXLX != null)
               {
                  strUpdateSQL += ",BSXLX='" + model.BSXLX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LTQY") == true && model.LTQY != null)
               {
                  strUpdateSQL += ",LTQY='" + model.LTQY.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LTGG") == true && model.LTGG != null)
               {
                  strUpdateSQL += ",LTGG='" + model.LTGG.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LTGGLX") == true && model.LTGGLX != null)
               {
                  strUpdateSQL += ",LTGGLX='" + model.LTGGLX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LTSL") == true && model.LTSL != null)
               {
                  strUpdateSQL += ",LTSL='" + model.LTSL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CSC") == true && model.CSC != null)
               {
                  strUpdateSQL += ",CSC='" + model.CSC.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CSK") == true && model.CSK != null)
               {
                  strUpdateSQL += ",CSK='" + model.CSK.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CSG") == true && model.CSG != null)
               {
                  strUpdateSQL += ",CSG='" + model.CSG.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZJ") == true && model.ZJ != null)
               {
                  strUpdateSQL += ",ZJ='" + model.ZJ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("BZZXS") == true && model.BZZXS != null)
               {
                  strUpdateSQL += ",BZZXS='" + model.BZZXS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YZLJ") == true && model.YZLJ != null)
               {
                  strUpdateSQL += ",YZLJ='" + model.YZLJ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("EZLJ") == true && model.EZLJ != null)
               {
                  strUpdateSQL += ",EZLJ='" + model.EZLJ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SZLJ") == true && model.SZLJ != null)
               {
                  strUpdateSQL += ",SZLJ='" + model.SZLJ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SIZLJ") == true && model.SIZLJ != null)
               {
                  strUpdateSQL += ",SIZLJ='" + model.SIZLJ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("WZLJ") == true && model.WZLJ != null)
               {
                  strUpdateSQL += ",WZLJ='" + model.WZLJ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LZLJ") == true && model.LZLJ != null)
               {
                  strUpdateSQL += ",LZLJ='" + model.LZLJ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YZZLZ") == true && model.YZZLZ != null)
               {
                  strUpdateSQL += ",YZZLZ='" + model.YZZLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YZYLZ") == true && model.YZYLZ != null)
               {
                  strUpdateSQL += ",YZYLZ='" + model.YZYLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YZZZ") == true && model.YZZZ != null)
               {
                  strUpdateSQL += ",YZZZ='" + model.YZZZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("EZZLZ") == true && model.EZZLZ != null)
               {
                  strUpdateSQL += ",EZZLZ='" + model.EZZLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("EZYLZ") == true && model.EZYLZ != null)
               {
                  strUpdateSQL += ",EZYLZ='" + model.EZYLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("EZZZ") == true && model.EZZZ != null)
               {
                  strUpdateSQL += ",EZZZ='" + model.EZZZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SZZLZ") == true && model.SZZLZ != null)
               {
                  strUpdateSQL += ",SZZLZ='" + model.SZZLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SZYLZ") == true && model.SZYLZ != null)
               {
                  strUpdateSQL += ",SZYLZ='" + model.SZYLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SZZZ") == true && model.SZZZ != null)
               {
                  strUpdateSQL += ",SZZZ='" + model.SZZZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SIZZLZ") == true && model.SIZZLZ != null)
               {
                  strUpdateSQL += ",SIZZLZ='" + model.SIZZLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SIZYLZ") == true && model.SIZYLZ != null)
               {
                  strUpdateSQL += ",SIZYLZ='" + model.SIZYLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SIZZZ") == true && model.SIZZZ != null)
               {
                  strUpdateSQL += ",SIZZZ='" + model.SIZZZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("WZZLZ") == true && model.WZZLZ != null)
               {
                  strUpdateSQL += ",WZZLZ='" + model.WZZLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("WZYLZ") == true && model.WZYLZ != null)
               {
                  strUpdateSQL += ",WZYLZ='" + model.WZYLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("WZZZ") == true && model.WZZZ != null)
               {
                  strUpdateSQL += ",WZZZ='" + model.WZZZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LZZLZ") == true && model.LZZLZ != null)
               {
                  strUpdateSQL += ",LZZLZ='" + model.LZZLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LZYLZ") == true && model.LZYLZ != null)
               {
                  strUpdateSQL += ",LZYLZ='" + model.LZYLZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LZZZ") == true && model.LZZZ != null)
               {
                  strUpdateSQL += ",LZZZ='" + model.LZZZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("QDZKZZL") == true && model.QDZKZZL != null)
               {
                  strUpdateSQL += ",QDZKZZL='" + model.QDZKZZL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YHXZ") == true && model.YHXZ != null)
               {
                  strUpdateSQL += ",YHXZ='" + model.YHXZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YHSD") == true && model.YHSD != null)
               {
                  strUpdateSQL += ",YHSD='" + model.YHSD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YDXZ") == true && model.YDXZ != null)
               {
                  strUpdateSQL += ",YDXZ='" + model.YDXZ.ToString().Replace("'","''") + "'";
               }

              string strSql = "";
              strSql += "update TYPE_CX_CONTENT set ";
              strSql += strUpdateSQL.Substring(1);
              strSql += " where " + p_strWhere;

              return strSql;
          }

          /// <summary>
          /// 修改一个集合
          /// </summary>
          public bool UpdateRange(TYPE_CX_CONTENT model, string p_strWhere)
          {
              return DbHelper.ExecuteSql(UpdateRangeSQL(model, p_strWhere));
          }

          /// <summary>
          /// 修改全部数据 SQL
          /// </summary>
          public string UpdateAllSQL(TYPE_CX_CONTENT model)
          {
              string strUpdateSQL = "";

                  strUpdateSQL += ",CPMC='" + model.CPMC.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",PP='" + model.PP.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",XH='" + model.XH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",PPXH='" + model.PPXH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CXDM='" + model.CXDM.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SFDABS='" + model.SFDABS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ABSZWZ='" + model.ABSZWZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",QDXS='" + model.QDXS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",QDZWZ='" + model.QDZWZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZCZWZ='" + model.ZCZWZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",QZDZ='" + model.QZDZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZBZL='" + model.ZBZL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZZL='" + model.ZZL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HDZH='" + model.HDZH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZZS='" + model.ZZS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CYS='" + model.CYS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZGSJCS='" + model.ZGSJCS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZDFS='" + model.ZDFS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CLZL='" + model.CLZL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZXZXJXS='" + model.ZXZXJXS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZXZLX='" + model.ZXZLX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",BSXLX='" + model.BSXLX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LTQY='" + model.LTQY.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LTGG='" + model.LTGG.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LTGGLX='" + model.LTGGLX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LTSL='" + model.LTSL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CSC='" + model.CSC.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CSK='" + model.CSK.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CSG='" + model.CSG.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZJ='" + model.ZJ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",BZZXS='" + model.BZZXS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YZLJ='" + model.YZLJ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",EZLJ='" + model.EZLJ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SZLJ='" + model.SZLJ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SIZLJ='" + model.SIZLJ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",WZLJ='" + model.WZLJ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LZLJ='" + model.LZLJ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YZZLZ='" + model.YZZLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YZYLZ='" + model.YZYLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YZZZ='" + model.YZZZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",EZZLZ='" + model.EZZLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",EZYLZ='" + model.EZYLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",EZZZ='" + model.EZZZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SZZLZ='" + model.SZZLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SZYLZ='" + model.SZYLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SZZZ='" + model.SZZZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SIZZLZ='" + model.SIZZLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SIZYLZ='" + model.SIZYLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SIZZZ='" + model.SIZZZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",WZZLZ='" + model.WZZLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",WZYLZ='" + model.WZYLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",WZZZ='" + model.WZZZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LZZLZ='" + model.LZZLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LZYLZ='" + model.LZYLZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LZZZ='" + model.LZZZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",QDZKZZL='" + model.QDZKZZL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YHXZ='" + model.YHXZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YHSD='" + model.YHSD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YDXZ='" + model.YDXZ.ToString().Replace("'","''") + "'";


               string strSql = "";
               strSql += "update TYPE_CX_CONTENT set ";
               strSql += strUpdateSQL.Substring(1);

               return strSql;

          }

          /// <summary>
          /// 修改全部数据
          /// </summary>
          public bool UpdateAll(TYPE_CX_CONTENT model)
          {
              return DbHelper.ExecuteSql(UpdateAllSQL(model));
          }

          /// <summary>
          /// 删除一条数据 SQL
          /// </summary>
          public string DeleteSQL(int intID)
          {
              string strSql = "";
              strSql += "delete from TYPE_CX_CONTENT";
              strSql += " where ";
               strSql += " ID="+ intID +"";

              return strSql;

          }

          /// <summary>
          /// 删除一条数据
          /// </summary>
          public bool Delete(int intID)
          {
              return DbHelper.ExecuteSql(DeleteSQL(intID));
          }

          /// <summary>
          /// 删除一个集合 SQL
          /// </summary>
          public string DeleteRangeSQL(string p_strWhere)
          {
              string strSql = "";
              strSql += "delete from TYPE_CX_CONTENT";
              strSql += " where " + p_strWhere;

              return strSql;
           }

          /// <summary>
          /// 删除一个集合
          /// </summary>
          public bool DeleteRange(string p_strWhere)
          {
              return DbHelper.ExecuteSql(DeleteRangeSQL(p_strWhere));
          }

          /// <summary>
          /// 删除全部 SQL
          /// </summary>
          public string DeleteAllSQL()
          {
              string strSql = "";
              strSql += "delete from TYPE_CX_CONTENT";

              return strSql;
           }

         /// <summary>
         /// 删除全部
         /// </summary>
         public bool DeleteAll()
         {
             return DbHelper.ExecuteSql(DeleteAllSQL());
         }

          /// <summary>
         /// 得到一个对象实体
         /// </summary>
         public TYPE_CX_CONTENT GetModel(int intID)
         {
             string strSql = "";
             strSql += "select * from TYPE_CX_CONTENT";
             strSql += " where ";
               strSql += " ID="+ intID +"";

             DataTable dtTemp = new DataTable();
             DbHelper.GetTable(strSql, ref dtTemp);

             TYPE_CX_CONTENT model = new TYPE_CX_CONTENT();

             if(dtTemp.Rows.Count>0)
             {
                 model = new TYPE_CX_CONTENT();

                 model.ID = dtTemp.Rows[0]["ID"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["ID"]);
                 model.CPMC = dtTemp.Rows[0]["CPMC"] == DBNull.Value ? "" : dtTemp.Rows[0]["CPMC"].ToString();
                 model.PP = dtTemp.Rows[0]["PP"] == DBNull.Value ? "" : dtTemp.Rows[0]["PP"].ToString();
                 model.XH = dtTemp.Rows[0]["XH"] == DBNull.Value ? "" : dtTemp.Rows[0]["XH"].ToString();
                 model.PPXH = dtTemp.Rows[0]["PPXH"] == DBNull.Value ? "" : dtTemp.Rows[0]["PPXH"].ToString();
                 model.CXDM = dtTemp.Rows[0]["CXDM"] == DBNull.Value ? "" : dtTemp.Rows[0]["CXDM"].ToString();
                 model.SFDABS = dtTemp.Rows[0]["SFDABS"] == DBNull.Value ? "" : dtTemp.Rows[0]["SFDABS"].ToString();
                 model.ABSZWZ = dtTemp.Rows[0]["ABSZWZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["ABSZWZ"].ToString();
                 model.QDXS = dtTemp.Rows[0]["QDXS"] == DBNull.Value ? "" : dtTemp.Rows[0]["QDXS"].ToString();
                 model.QDZWZ = dtTemp.Rows[0]["QDZWZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["QDZWZ"].ToString();
                 model.ZCZWZ = dtTemp.Rows[0]["ZCZWZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZCZWZ"].ToString();
                 model.QZDZ = dtTemp.Rows[0]["QZDZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["QZDZ"].ToString();
                 model.ZBZL = dtTemp.Rows[0]["ZBZL"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZBZL"].ToString();
                 model.ZZL = dtTemp.Rows[0]["ZZL"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZZL"].ToString();
                 model.HDZH = dtTemp.Rows[0]["HDZH"] == DBNull.Value ? "" : dtTemp.Rows[0]["HDZH"].ToString();
                 model.ZZS = dtTemp.Rows[0]["ZZS"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZZS"].ToString();
                 model.CYS = dtTemp.Rows[0]["CYS"] == DBNull.Value ? "" : dtTemp.Rows[0]["CYS"].ToString();
                 model.ZGSJCS = dtTemp.Rows[0]["ZGSJCS"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZGSJCS"].ToString();
                 model.ZDFS = dtTemp.Rows[0]["ZDFS"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZDFS"].ToString();
                 model.CLZL = dtTemp.Rows[0]["CLZL"] == DBNull.Value ? "" : dtTemp.Rows[0]["CLZL"].ToString();
                 model.ZXZXJXS = dtTemp.Rows[0]["ZXZXJXS"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZXZXJXS"].ToString();
                 model.ZXZLX = dtTemp.Rows[0]["ZXZLX"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZXZLX"].ToString();
                 model.BSXLX = dtTemp.Rows[0]["BSXLX"] == DBNull.Value ? "" : dtTemp.Rows[0]["BSXLX"].ToString();
                 model.LTQY = dtTemp.Rows[0]["LTQY"] == DBNull.Value ? "" : dtTemp.Rows[0]["LTQY"].ToString();
                 model.LTGG = dtTemp.Rows[0]["LTGG"] == DBNull.Value ? "" : dtTemp.Rows[0]["LTGG"].ToString();
                 model.LTGGLX = dtTemp.Rows[0]["LTGGLX"] == DBNull.Value ? "" : dtTemp.Rows[0]["LTGGLX"].ToString();
                 model.LTSL = dtTemp.Rows[0]["LTSL"] == DBNull.Value ? "" : dtTemp.Rows[0]["LTSL"].ToString();
                 model.CSC = dtTemp.Rows[0]["CSC"] == DBNull.Value ? "" : dtTemp.Rows[0]["CSC"].ToString();
                 model.CSK = dtTemp.Rows[0]["CSK"] == DBNull.Value ? "" : dtTemp.Rows[0]["CSK"].ToString();
                 model.CSG = dtTemp.Rows[0]["CSG"] == DBNull.Value ? "" : dtTemp.Rows[0]["CSG"].ToString();
                 model.ZJ = dtTemp.Rows[0]["ZJ"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZJ"].ToString();
                 model.BZZXS = dtTemp.Rows[0]["BZZXS"] == DBNull.Value ? "" : dtTemp.Rows[0]["BZZXS"].ToString();
                 model.YZLJ = dtTemp.Rows[0]["YZLJ"] == DBNull.Value ? "" : dtTemp.Rows[0]["YZLJ"].ToString();
                 model.EZLJ = dtTemp.Rows[0]["EZLJ"] == DBNull.Value ? "" : dtTemp.Rows[0]["EZLJ"].ToString();
                 model.SZLJ = dtTemp.Rows[0]["SZLJ"] == DBNull.Value ? "" : dtTemp.Rows[0]["SZLJ"].ToString();
                 model.SIZLJ = dtTemp.Rows[0]["SIZLJ"] == DBNull.Value ? "" : dtTemp.Rows[0]["SIZLJ"].ToString();
                 model.WZLJ = dtTemp.Rows[0]["WZLJ"] == DBNull.Value ? "" : dtTemp.Rows[0]["WZLJ"].ToString();
                 model.LZLJ = dtTemp.Rows[0]["LZLJ"] == DBNull.Value ? "" : dtTemp.Rows[0]["LZLJ"].ToString();
                 model.YZZLZ = dtTemp.Rows[0]["YZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["YZZLZ"].ToString();
                 model.YZYLZ = dtTemp.Rows[0]["YZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["YZYLZ"].ToString();
                 model.YZZZ = dtTemp.Rows[0]["YZZZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["YZZZ"].ToString();
                 model.EZZLZ = dtTemp.Rows[0]["EZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["EZZLZ"].ToString();
                 model.EZYLZ = dtTemp.Rows[0]["EZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["EZYLZ"].ToString();
                 model.EZZZ = dtTemp.Rows[0]["EZZZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["EZZZ"].ToString();
                 model.SZZLZ = dtTemp.Rows[0]["SZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["SZZLZ"].ToString();
                 model.SZYLZ = dtTemp.Rows[0]["SZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["SZYLZ"].ToString();
                 model.SZZZ = dtTemp.Rows[0]["SZZZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["SZZZ"].ToString();
                 model.SIZZLZ = dtTemp.Rows[0]["SIZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["SIZZLZ"].ToString();
                 model.SIZYLZ = dtTemp.Rows[0]["SIZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["SIZYLZ"].ToString();
                 model.SIZZZ = dtTemp.Rows[0]["SIZZZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["SIZZZ"].ToString();
                 model.WZZLZ = dtTemp.Rows[0]["WZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["WZZLZ"].ToString();
                 model.WZYLZ = dtTemp.Rows[0]["WZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["WZYLZ"].ToString();
                 model.WZZZ = dtTemp.Rows[0]["WZZZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["WZZZ"].ToString();
                 model.LZZLZ = dtTemp.Rows[0]["LZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["LZZLZ"].ToString();
                 model.LZYLZ = dtTemp.Rows[0]["LZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["LZYLZ"].ToString();
                 model.LZZZ = dtTemp.Rows[0]["LZZZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["LZZZ"].ToString();
                 model.QDZKZZL = dtTemp.Rows[0]["QDZKZZL"] == DBNull.Value ? "" : dtTemp.Rows[0]["QDZKZZL"].ToString();
                 model.YHXZ = dtTemp.Rows[0]["YHXZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["YHXZ"].ToString();
                 model.YHSD = dtTemp.Rows[0]["YHSD"] == DBNull.Value ? "" : dtTemp.Rows[0]["YHSD"].ToString();
                 model.YDXZ = dtTemp.Rows[0]["YDXZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["YDXZ"].ToString();
             }

             dtTemp.Dispose();

             return model;
         }

         /// <summary>
         /// 得到一个对象实体
         /// </summary>
         public void GetModel(ref DataTable p_dtData, int intID)
         {
             p_dtData.Clear();

             string strSql = "";
             strSql += "select * from TYPE_CX_CONTENT";
             strSql += " where ";
               strSql += " ID="+ intID +"";

              DbHelper.GetTable(strSql, ref p_dtData);
         }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public TYPE_CX_CONTENT[] GetModelList(string p_strWhere, string p_strOrder, int p_intPageNumber, int p_intPageSize)
      {
          int m_intPageNumber = p_intPageNumber;
          int m_intPageCount = GetPageCount(p_strWhere, p_intPageSize);

          if((m_intPageNumber < 1) || (m_intPageNumber == 0))
          {
               m_intPageNumber = 1;
          }

          if(m_intPageNumber == -1)
          {
               m_intPageNumber = m_intPageCount;
          }

          if(m_intPageNumber > m_intPageCount)
          {
               m_intPageNumber = m_intPageCount;
          }

          string strSql = "";
          strSql += "select * from TYPE_CX_CONTENT";
          if(p_strWhere.Trim().Length > 0)
          {
               strSql += " where " + p_strWhere;
          }
          if(p_strOrder.Trim().Length > 0)
          {
               strSql += " order by " + p_strOrder;
          }

          DataTable dtTemp = new DataTable();

          if(p_intPageSize > 0)
          {
               DbHelper.GetTable(strSql, ref dtTemp, (m_intPageNumber-1)*p_intPageSize, p_intPageSize);
          }
          else
          {
               DbHelper.GetTable(strSql, ref dtTemp);
          }

          TYPE_CX_CONTENT[] arrModel=new TYPE_CX_CONTENT[dtTemp.Rows.Count];

          for(int N=0;N<dtTemp.Rows.Count;N++)
          {
               arrModel[N] = new TYPE_CX_CONTENT();

                 arrModel[N].ID = dtTemp.Rows[N]["ID"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["ID"]);
                 arrModel[N].CPMC = dtTemp.Rows[N]["CPMC"] == DBNull.Value ? "" : dtTemp.Rows[N]["CPMC"].ToString();
                 arrModel[N].PP = dtTemp.Rows[N]["PP"] == DBNull.Value ? "" : dtTemp.Rows[N]["PP"].ToString();
                 arrModel[N].XH = dtTemp.Rows[N]["XH"] == DBNull.Value ? "" : dtTemp.Rows[N]["XH"].ToString();
                 arrModel[N].PPXH = dtTemp.Rows[N]["PPXH"] == DBNull.Value ? "" : dtTemp.Rows[N]["PPXH"].ToString();
                 arrModel[N].CXDM = dtTemp.Rows[N]["CXDM"] == DBNull.Value ? "" : dtTemp.Rows[N]["CXDM"].ToString();
                 arrModel[N].SFDABS = dtTemp.Rows[N]["SFDABS"] == DBNull.Value ? "" : dtTemp.Rows[N]["SFDABS"].ToString();
                 arrModel[N].ABSZWZ = dtTemp.Rows[N]["ABSZWZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["ABSZWZ"].ToString();
                 arrModel[N].QDXS = dtTemp.Rows[N]["QDXS"] == DBNull.Value ? "" : dtTemp.Rows[N]["QDXS"].ToString();
                 arrModel[N].QDZWZ = dtTemp.Rows[N]["QDZWZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["QDZWZ"].ToString();
                 arrModel[N].ZCZWZ = dtTemp.Rows[N]["ZCZWZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZCZWZ"].ToString();
                 arrModel[N].QZDZ = dtTemp.Rows[N]["QZDZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["QZDZ"].ToString();
                 arrModel[N].ZBZL = dtTemp.Rows[N]["ZBZL"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZBZL"].ToString();
                 arrModel[N].ZZL = dtTemp.Rows[N]["ZZL"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZZL"].ToString();
                 arrModel[N].HDZH = dtTemp.Rows[N]["HDZH"] == DBNull.Value ? "" : dtTemp.Rows[N]["HDZH"].ToString();
                 arrModel[N].ZZS = dtTemp.Rows[N]["ZZS"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZZS"].ToString();
                 arrModel[N].CYS = dtTemp.Rows[N]["CYS"] == DBNull.Value ? "" : dtTemp.Rows[N]["CYS"].ToString();
                 arrModel[N].ZGSJCS = dtTemp.Rows[N]["ZGSJCS"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZGSJCS"].ToString();
                 arrModel[N].ZDFS = dtTemp.Rows[N]["ZDFS"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZDFS"].ToString();
                 arrModel[N].CLZL = dtTemp.Rows[N]["CLZL"] == DBNull.Value ? "" : dtTemp.Rows[N]["CLZL"].ToString();
                 arrModel[N].ZXZXJXS = dtTemp.Rows[N]["ZXZXJXS"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZXZXJXS"].ToString();
                 arrModel[N].ZXZLX = dtTemp.Rows[N]["ZXZLX"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZXZLX"].ToString();
                 arrModel[N].BSXLX = dtTemp.Rows[N]["BSXLX"] == DBNull.Value ? "" : dtTemp.Rows[N]["BSXLX"].ToString();
                 arrModel[N].LTQY = dtTemp.Rows[N]["LTQY"] == DBNull.Value ? "" : dtTemp.Rows[N]["LTQY"].ToString();
                 arrModel[N].LTGG = dtTemp.Rows[N]["LTGG"] == DBNull.Value ? "" : dtTemp.Rows[N]["LTGG"].ToString();
                 arrModel[N].LTGGLX = dtTemp.Rows[N]["LTGGLX"] == DBNull.Value ? "" : dtTemp.Rows[N]["LTGGLX"].ToString();
                 arrModel[N].LTSL = dtTemp.Rows[N]["LTSL"] == DBNull.Value ? "" : dtTemp.Rows[N]["LTSL"].ToString();
                 arrModel[N].CSC = dtTemp.Rows[N]["CSC"] == DBNull.Value ? "" : dtTemp.Rows[N]["CSC"].ToString();
                 arrModel[N].CSK = dtTemp.Rows[N]["CSK"] == DBNull.Value ? "" : dtTemp.Rows[N]["CSK"].ToString();
                 arrModel[N].CSG = dtTemp.Rows[N]["CSG"] == DBNull.Value ? "" : dtTemp.Rows[N]["CSG"].ToString();
                 arrModel[N].ZJ = dtTemp.Rows[N]["ZJ"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZJ"].ToString();
                 arrModel[N].BZZXS = dtTemp.Rows[N]["BZZXS"] == DBNull.Value ? "" : dtTemp.Rows[N]["BZZXS"].ToString();
                 arrModel[N].YZLJ = dtTemp.Rows[N]["YZLJ"] == DBNull.Value ? "" : dtTemp.Rows[N]["YZLJ"].ToString();
                 arrModel[N].EZLJ = dtTemp.Rows[N]["EZLJ"] == DBNull.Value ? "" : dtTemp.Rows[N]["EZLJ"].ToString();
                 arrModel[N].SZLJ = dtTemp.Rows[N]["SZLJ"] == DBNull.Value ? "" : dtTemp.Rows[N]["SZLJ"].ToString();
                 arrModel[N].SIZLJ = dtTemp.Rows[N]["SIZLJ"] == DBNull.Value ? "" : dtTemp.Rows[N]["SIZLJ"].ToString();
                 arrModel[N].WZLJ = dtTemp.Rows[N]["WZLJ"] == DBNull.Value ? "" : dtTemp.Rows[N]["WZLJ"].ToString();
                 arrModel[N].LZLJ = dtTemp.Rows[N]["LZLJ"] == DBNull.Value ? "" : dtTemp.Rows[N]["LZLJ"].ToString();
                 arrModel[N].YZZLZ = dtTemp.Rows[N]["YZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["YZZLZ"].ToString();
                 arrModel[N].YZYLZ = dtTemp.Rows[N]["YZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["YZYLZ"].ToString();
                 arrModel[N].YZZZ = dtTemp.Rows[N]["YZZZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["YZZZ"].ToString();
                 arrModel[N].EZZLZ = dtTemp.Rows[N]["EZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["EZZLZ"].ToString();
                 arrModel[N].EZYLZ = dtTemp.Rows[N]["EZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["EZYLZ"].ToString();
                 arrModel[N].EZZZ = dtTemp.Rows[N]["EZZZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["EZZZ"].ToString();
                 arrModel[N].SZZLZ = dtTemp.Rows[N]["SZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["SZZLZ"].ToString();
                 arrModel[N].SZYLZ = dtTemp.Rows[N]["SZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["SZYLZ"].ToString();
                 arrModel[N].SZZZ = dtTemp.Rows[N]["SZZZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["SZZZ"].ToString();
                 arrModel[N].SIZZLZ = dtTemp.Rows[N]["SIZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["SIZZLZ"].ToString();
                 arrModel[N].SIZYLZ = dtTemp.Rows[N]["SIZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["SIZYLZ"].ToString();
                 arrModel[N].SIZZZ = dtTemp.Rows[N]["SIZZZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["SIZZZ"].ToString();
                 arrModel[N].WZZLZ = dtTemp.Rows[N]["WZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["WZZLZ"].ToString();
                 arrModel[N].WZYLZ = dtTemp.Rows[N]["WZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["WZYLZ"].ToString();
                 arrModel[N].WZZZ = dtTemp.Rows[N]["WZZZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["WZZZ"].ToString();
                 arrModel[N].LZZLZ = dtTemp.Rows[N]["LZZLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["LZZLZ"].ToString();
                 arrModel[N].LZYLZ = dtTemp.Rows[N]["LZYLZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["LZYLZ"].ToString();
                 arrModel[N].LZZZ = dtTemp.Rows[N]["LZZZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["LZZZ"].ToString();
                 arrModel[N].QDZKZZL = dtTemp.Rows[N]["QDZKZZL"] == DBNull.Value ? "" : dtTemp.Rows[N]["QDZKZZL"].ToString();
                 arrModel[N].YHXZ = dtTemp.Rows[N]["YHXZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["YHXZ"].ToString();
                 arrModel[N].YHSD = dtTemp.Rows[N]["YHSD"] == DBNull.Value ? "" : dtTemp.Rows[N]["YHSD"].ToString();
                 arrModel[N].YDXZ = dtTemp.Rows[N]["YDXZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["YDXZ"].ToString();
          }

          dtTemp.Dispose();

          return arrModel;
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public TYPE_CX_CONTENT[] GetModelList(string p_strWhere)
      {
          return GetModelList(p_strWhere, "", -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public TYPE_CX_CONTENT[] GetModelList(string p_strWhere, string p_strOrder)
      {
          return GetModelList(p_strWhere, p_strOrder, -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public TYPE_CX_CONTENT[] GetModelList(int p_intPageNumber, int p_intPageSize)
      {
          return GetModelList("", "", p_intPageNumber, p_intPageSize);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public TYPE_CX_CONTENT[] GetModelList(string p_strWhere, int p_intPageNumber, int p_intPageSize)
      {
          return GetModelList(p_strWhere, "", p_intPageNumber, p_intPageSize);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public TYPE_CX_CONTENT[] GetModelList()
      {
          return GetModelList("", "", -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public void GetModelList(ref DataTable p_dtData, string p_strWhere, string p_strOrder, int p_intPageNumber, int p_intPageSize)
      {
          p_dtData.Clear();

          int m_intPageNumber = p_intPageNumber;
          int m_intPageCount = GetPageCount(p_strWhere, p_intPageSize);

          if((m_intPageNumber < 1) || (m_intPageNumber == 0))
          {
              m_intPageNumber = 1;
          }

          if(m_intPageNumber == -1)
          {
              m_intPageNumber = m_intPageCount;
          }

          if(m_intPageNumber > m_intPageCount)
          {
              m_intPageNumber = m_intPageCount;
          }

          string strSql = "";
          strSql += "select * from TYPE_CX_CONTENT";
          if(p_strWhere.Trim().Length > 0)
          {
              strSql += " where " + p_strWhere;
          }
          if(p_strOrder.Trim().Length > 0)
          {
              strSql += " order by " + p_strOrder;
          }

          if(p_intPageSize > 0)
          {
              DbHelper.GetTable(strSql, ref p_dtData, (m_intPageNumber-1)*p_intPageSize, p_intPageSize);
          }
          else
          {
              DbHelper.GetTable(strSql, ref p_dtData);
          }
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere)
       {
           GetModelList(ref p_dtData, p_strWhere, "", -1, -1);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere, string p_strOrder)
       {
           GetModelList(ref p_dtData, p_strWhere, p_strOrder, -1, -1);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, int p_intPageNumber, int p_intPageSize)
       {
           GetModelList(ref p_dtData, "", "", p_intPageNumber, p_intPageSize);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere, int p_intPageNumber, int p_intPageSize)
       {
           GetModelList(ref p_dtData, p_strWhere, "", p_intPageNumber, p_intPageSize);
       }
       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData)
       {
           GetModelList(ref p_dtData, "", "", -1, -1);
       }
   }
}
